package com.szzg10.pattern.proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class PersonProxy implements InvocationHandler {

	private Person person;
	
	public PersonProxy(Person person) {
		this.person = person;
	}
	
	@Override
	public Object invoke(Object proxy, Method method, Object[] args)
			throws Throwable {
		
		System.out.println("Before method!!!");
		Object object = method.invoke(person, args);
		System.out.println("After method!!!");
		
		return object;
	}

}
